package com.schoolgard.entitybean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "UPGRADE_TO_DEVICE")
@SequenceGenerator (name="AUTO_ID", sequenceName="AUTO_ID")
public class UpgradeToDevice implements java.io.Serializable {

	private static final long serialVersionUID = 201203202110L;
	private Long id;
	private JobMode jobMode;
	private JobStatus jobStatus;
	private String guid;
	private String fileName;
	private String newVersion;
	private String enable;
	private String router;
	private java.util.Date createDatetime;
	private Long userId;
	private String userName;
	private java.util.Date startDownloadDatetime;
	private java.util.Date finishDatetime;
	private String oldVersion;
	private Integer downloadSpend;
	private Integer type;
	private String objectName;

	@Id
	@Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
	@GeneratedValue (strategy=GenerationType.SEQUENCE, generator="AUTO_ID")		
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "JOB_MODE_ID", nullable = false)
	public JobMode getJobMode() {
		return this.jobMode;
	}

	public void setJobMode(JobMode jobMode) {
		this.jobMode = jobMode;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "JOB_STATUS_ID", nullable = false)
	public JobStatus getJobStatus() {
		return this.jobStatus;
	}

	public void setJobStatus(JobStatus jobStatus) {
		this.jobStatus = jobStatus;
	}

	@Column(name = "GUID", length = 32)
	public String getGuid() {
		return this.guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	@Column(name = "FILE_NAME", length = 510)
	public String getFileName() {
		return this.fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	@Column(name = "NEW_VERSION", length = 48)
	public String getNewVersion() {
		return this.newVersion;
	}

	public void setNewVersion(String newVersion) {
		this.newVersion = newVersion;
	}

	@Column(name = "ENABLE", length = 2)
	public String getEnable() {
		return this.enable;
	}

	public void setEnable(String enable) {
		this.enable = enable;
	}

	@Column(name = "ROUTER", length = 510)
	public String getRouter() {
		return this.router;
	}

	public void setRouter(String router) {
		this.router = router;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATETIME")
	public java.util.Date getCreateDatetime() {
		return this.createDatetime;
	}

	public void setCreateDatetime(java.util.Date createDatetime) {
		this.createDatetime = createDatetime;
	}

	@Column(name = "USER_ID", precision = 10, scale = 0)
	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	@Column(name = "USER_NAME", length = 64)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_DOWNLOAD_DATETIME")
	public java.util.Date getStartDownloadDatetime() {
		return this.startDownloadDatetime;
	}

	public void setStartDownloadDatetime(java.util.Date startDownloadDatetime) {
		this.startDownloadDatetime = startDownloadDatetime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FINISH_DATETIME")
	public java.util.Date getFinishDatetime() {
		return this.finishDatetime;
	}

	public void setFinishDatetime(java.util.Date finishDatetime) {
		this.finishDatetime = finishDatetime;
	}

	@Column(name = "OLD_VERSION", length = 48)
	public String getOldVersion() {
		return this.oldVersion;
	}

	public void setOldVersion(String oldVersion) {
		this.oldVersion = oldVersion;
	}

	@Column(name = "DOWNLOAD_SPEND")
	public Integer getDownloadSpend() {
		return this.downloadSpend;
	}

	public void setDownloadSpend(Integer downloadSpend) {
		this.downloadSpend = downloadSpend;
	}

	@Column(name = "TYPE")
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "OBJECT_NAME")
	public String getObjectName() {
		return objectName;
	}
	
	public void setObjectName(String objectName) {
		this.objectName = objectName;
	}

}